﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace gpao2012
{
    public partial class listeouvrieres : DevExpress.XtraEditors.XtraUserControl
    {
        public listeouvrieres()
        {
            InitializeComponent();
        }

        private void barButtonItem5_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {

        }

        private void listedesouvriéres_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'gpaogscofficielDataSet.ouvriere' table. You can move, or remove it, as needed.
            this.ouvriereTableAdapter.Fill(this.gpaogscofficielDataSet.ouvriere);

        }


        private void simpleButton4_Click(object sender, EventArgs e)
        {
            if (saveFileDialog1.ShowDialog() == DialogResult.OK)
            {
                string chemin = System.IO.Path.GetFullPath(saveFileDialog1.FileName)+".pdf";
                gridControl1.ExportToPdf(chemin);
            }
        }

        private void simpleButton5_Click(object sender, EventArgs e)
        {
            if (saveFileDialog2.ShowDialog() == DialogResult.OK)
            {
                string chemin = System.IO.Path.GetFullPath(saveFileDialog2.FileName);
                gridControl1.ExportToRtf(chemin);
            }
        }

        private void simpleButton6_Click(object sender, EventArgs e)
        {
            if (saveFileDialog3.ShowDialog() == DialogResult.OK)
            {
                string chemin = System.IO.Path.GetFullPath(saveFileDialog3.FileName);
                gridControl1.ExportToXlsx(chemin);
            }
        }

        private void simpleButton1_Click(object sender, EventArgs e)
        {
            try
            {
                this.Validate();
                this.ouvriereBindingSource.EndEdit();
                this.ouvriereTableAdapter.Update(this.gpaogscofficielDataSet.ouvriere);
                this.barstatustext.ForeColor = System.Drawing.Color.Lime;
                barstatustext.Text = "Enregistrement éffectué";

            }
            catch (System.Exception ex)
            {
                this.barstatustext.ForeColor = System.Drawing.Color.Red;
                barstatustext.Text = "Erreur";
            }
        }
    }
}